import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;

public class ShouSi {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] input = scanner.nextLine().split(" ");
        int n = input.length;
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = Integer.parseInt(input[i]);
        }
        Stack<Integer> stack = new Stack<>();
        int[] ans = Arrays.copyOf(nums, n);

        for (int i = 0; i < 2 * n; i++) {//循环一次
            int idx = i % n;//取模
            int num = nums[idx];//第idx个寿司
            // 当栈不为空，从栈拿出来的元素
            while (!stack.isEmpty() && nums[stack.peek()] > num) {
                int topIdx = stack.pop();
                ans[topIdx] = num + nums[topIdx];
            }
            stack.push(idx);
        }

        for (int i = 0; i < n; i++) {
            System.out.print(ans[i] + " ");
        }
    }

}
